#include<iostream>
#include<cstdlib>
using namespace std;
template <typename T1=double>
class CSafeArray
{
    int size;
    T1 *a;
    public:
    CSafeArray(int n=128)//默认参数
    {
        size=n;
        a=new T1[size];
        for(int i=0;i<n;i++)
        {
            a[i]=rand()%50/3.0;//size个从0-49以内的数字
        }
    }
    T1 &operator[](int i)//合法性检验
    {
      if(i<0||i>=size)
      {
        cout<<i<<"out of boundary"<<endl;
        exit(1);
      }
      else
      return a[i];
    }
    ~CSafeArray()
    {
        if (a!=nullptr)
        {
            delete []a;
        }
    }
    
};
int main()
{
    int n;
    cin>>n;
    CSafeArray<int7>a(n);
    for(int i=0;i<n;i++)
    {
        cout<<a[i]<<" ";
    }
    cout<<endl;
    return 0;
}